package com.cdty.chess.service.impl;

import com.cdty.chess.service.WebSocketEventHandler;
import com.fasterxml.jackson.databind.JsonNode;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.WebSocketSession;

@Component
public class SystemNotificationHandler implements WebSocketEventHandler {
    @Override
    public String getEventType() {
        return "system_notification";
    }

    @Override
    public void handleEvent(WebSocketSession session, JsonNode data) {
        String message = data.get("message").asText();
        // 处理系统通知逻辑
        System.out.println("发送系统通知：" + message);
    }
}